


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html id="htmlId">
<head>
  <title>Coverage Report :: DefaultViennaContext</title>
  <style type="text/css">
    @import "../../.css/coverage.css";
  </style>
</head>

<body>
<div class="header"></div>

<div class="content">
<div class="breadCrumbs">
    [ <a href="../../index.html">all classes</a> ]
    [ <a href="../index.html">at.schauer.gregor.vienna.context</a> ]
</div>

<h1>Coverage Summary for Class: DefaultViennaContext (at.schauer.gregor.vienna.context)</h1>

<table class="coverageStats">
<tr>
  <th class="name">Class</th>
<th class="coverageStat 
">
  Class, %
</th>
<th class="coverageStat 
">
  Method, %
</th>
<th class="coverageStat 
">
  Line, %
</th>
</tr>
<tr>
  <td class="name">DefaultViennaContext</td>
<td class="coverageStat">
  <span class="percent">
    100%
  </span>
  <span class="absValue">
    (1/ 1)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    62.5%
  </span>
  <span class="absValue">
    (10/ 16)
  </span>
</td>
<td class="coverageStat">
  <span class="percent">
    76.9%
  </span>
  <span class="absValue">
    (20/ 26)
  </span>
</td>
</tr>

</table>

<br/>
<br/>


<div class="sourceCode"><i>1</i>&nbsp;/*
<i>2</i>&nbsp; * Copyright 2012 Gregor Schauer
<i>3</i>&nbsp; *
<i>4</i>&nbsp; * Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
<i>5</i>&nbsp; * you may not use this file except in compliance with the License.
<i>6</i>&nbsp; * You may obtain a copy of the License at
<i>7</i>&nbsp; *
<i>8</i>&nbsp; *      http://www.apache.org/licenses/LICENSE-2.0
<i>9</i>&nbsp; *
<i>10</i>&nbsp; * Unless required by applicable law or agreed to in writing, software
<i>11</i>&nbsp; * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,
<i>12</i>&nbsp; * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
<i>13</i>&nbsp; * See the License for the specific language governing permissions and
<i>14</i>&nbsp; * limitations under the License.
<i>15</i>&nbsp; */
<i>16</i>&nbsp;package at.schauer.gregor.vienna.context;
<i>17</i>&nbsp;
<i>18</i>&nbsp;import at.schauer.gregor.vienna.convert.provider.ConverterProvider;
<i>19</i>&nbsp;import at.schauer.gregor.vienna.datastore.DataStore;
<i>20</i>&nbsp;import at.schauer.gregor.vienna.identifier.IdentifierGenerator;
<i>21</i>&nbsp;import at.schauer.gregor.vienna.metadata.MetadataProvider;
<i>22</i>&nbsp;import at.schauer.gregor.vienna.serializer.Serializer;
<i>23</i>&nbsp;import at.schauer.gregor.vienna.util.ViennaUtils;
<i>24</i>&nbsp;
<i>25</i>&nbsp;import java.util.*;
<i>26</i>&nbsp;
<i>27</i>&nbsp;/**
<i>28</i>&nbsp; * @author Gregor Schauer
<i>29</i>&nbsp; */
<b class="fc"><i>30</i>&nbsp;public class DefaultViennaContext implements ViennaContext {</b>
<b class="fc"><i>31</i>&nbsp;	protected Map&lt;Class&lt;?&gt;, ConverterProvider&lt;?&gt;&gt; converterProviderMap = new LinkedHashMap&lt;Class&lt;?&gt;, ConverterProvider&lt;?&gt;&gt;();</b>
<b class="fc"><i>32</i>&nbsp;	protected Map&lt;Class&lt;?&gt;, Serializer&lt;?&gt;&gt; serializerMap = new HashMap&lt;Class&lt;?&gt;, Serializer&lt;?&gt;&gt;();</b>
<b class="fc"><i>33</i>&nbsp;	protected Map&lt;Class&lt;?&gt;, MetadataProvider&lt;?&gt;&gt; metadataProviderMap = new HashMap&lt;Class&lt;?&gt;, MetadataProvider&lt;?&gt;&gt;();</b>
<b class="fc"><i>34</i>&nbsp;	protected Map&lt;Class&lt;?&gt;, DataStore&lt;?&gt;&gt; dataStoreMap = new HashMap&lt;Class&lt;?&gt;, DataStore&lt;?&gt;&gt;();</b>
<b class="fc"><i>35</i>&nbsp;	protected Map&lt;Class&lt;?&gt;, IdentifierGenerator&lt;?, ?&gt;&gt; identifierGeneratorMap = new HashMap&lt;Class&lt;?&gt;, IdentifierGenerator&lt;?, ?&gt;&gt;();</b>
<i>36</i>&nbsp;
<i>37</i>&nbsp;	@Override
<i>38</i>&nbsp;	@SuppressWarnings(&quot;unchecked&quot;)
<i>39</i>&nbsp;	public &lt;T&gt; ConverterProvider&lt;T&gt; getConverterProvider(Class&lt;T&gt; type) {
<b class="fc"><i>40</i>&nbsp;		return (ConverterProvider&lt;T&gt;) ViennaUtils.filter(converterProviderMap, type);</b>
<i>41</i>&nbsp;	}
<i>42</i>&nbsp;
<i>43</i>&nbsp;	@Override
<i>44</i>&nbsp;	@SuppressWarnings(&quot;unchecked&quot;)
<i>45</i>&nbsp;	public &lt;T&gt; Serializer&lt;T&gt; getSerializer(Class&lt;T&gt; type) {
<b class="fc"><i>46</i>&nbsp;		return (Serializer&lt;T&gt;) ViennaUtils.filter(serializerMap, type);</b>
<i>47</i>&nbsp;	}
<i>48</i>&nbsp;
<i>49</i>&nbsp;	@Override
<i>50</i>&nbsp;	@SuppressWarnings(&quot;unchecked&quot;)
<i>51</i>&nbsp;	public &lt;T&gt; MetadataProvider&lt;T&gt; getMetadataProvider(Class&lt;T&gt; type) {
<b class="fc"><i>52</i>&nbsp;		return (MetadataProvider&lt;T&gt;) ViennaUtils.filter(metadataProviderMap, type);</b>
<i>53</i>&nbsp;	}
<i>54</i>&nbsp;
<i>55</i>&nbsp;	@Override
<i>56</i>&nbsp;	@SuppressWarnings(&quot;unchecked&quot;)
<i>57</i>&nbsp;	public &lt;T&gt; DataStore&lt;T&gt; getDataStore(Class&lt;T&gt; type) {
<b class="nc"><i>58</i>&nbsp;		return (DataStore&lt;T&gt;) ViennaUtils.filter(dataStoreMap, type);</b>
<i>59</i>&nbsp;	}
<i>60</i>&nbsp;
<i>61</i>&nbsp;	@Override
<i>62</i>&nbsp;	@SuppressWarnings(&quot;unchecked&quot;)
<i>63</i>&nbsp;	public &lt;I, T&gt; IdentifierGenerator&lt;I, T&gt; getIdentifierGenerator(Class&lt;T&gt; type) {
<b class="fc"><i>64</i>&nbsp;		return (IdentifierGenerator&lt;I, T&gt;) ViennaUtils.filter(identifierGeneratorMap, type);</b>
<i>65</i>&nbsp;	}
<i>66</i>&nbsp;
<i>67</i>&nbsp;	public Map&lt;Class&lt;?&gt;, ConverterProvider&lt;?&gt;&gt; getConverterProviderMap() {
<b class="nc"><i>68</i>&nbsp;		return converterProviderMap;</b>
<i>69</i>&nbsp;	}
<i>70</i>&nbsp;
<i>71</i>&nbsp;	public void setConverterProviderMap(Map&lt;Class&lt;?&gt;, ConverterProvider&lt;?&gt;&gt; converterProviderMap) {
<b class="fc"><i>72</i>&nbsp;		this.converterProviderMap = converterProviderMap;</b>
<b class="fc"><i>73</i>&nbsp;	}</b>
<i>74</i>&nbsp;
<i>75</i>&nbsp;	public Map&lt;Class&lt;?&gt;, Serializer&lt;?&gt;&gt; getSerializerMap() {
<b class="nc"><i>76</i>&nbsp;		return serializerMap;</b>
<i>77</i>&nbsp;	}
<i>78</i>&nbsp;
<i>79</i>&nbsp;	public void setSerializerMap(Map&lt;Class&lt;?&gt;, Serializer&lt;?&gt;&gt; serializerMap) {
<b class="fc"><i>80</i>&nbsp;		this.serializerMap = serializerMap;</b>
<b class="fc"><i>81</i>&nbsp;	}</b>
<i>82</i>&nbsp;
<i>83</i>&nbsp;	public Map&lt;Class&lt;?&gt;, MetadataProvider&lt;?&gt;&gt; getMetadataProviderMap() {
<b class="nc"><i>84</i>&nbsp;		return metadataProviderMap;</b>
<i>85</i>&nbsp;	}
<i>86</i>&nbsp;
<i>87</i>&nbsp;	public void setMetadataProviderMap(Map&lt;Class&lt;?&gt;, MetadataProvider&lt;?&gt;&gt; metadataProviderMap) {
<b class="fc"><i>88</i>&nbsp;		this.metadataProviderMap = metadataProviderMap;</b>
<b class="fc"><i>89</i>&nbsp;	}</b>
<i>90</i>&nbsp;
<i>91</i>&nbsp;	public Map&lt;Class&lt;?&gt;, DataStore&lt;?&gt;&gt; getDataStoreMap() {
<b class="nc"><i>92</i>&nbsp;		return dataStoreMap;</b>
<i>93</i>&nbsp;	}
<i>94</i>&nbsp;
<i>95</i>&nbsp;	public void setDataStoreMap(Map&lt;Class&lt;?&gt;, DataStore&lt;?&gt;&gt; dataStoreMap) {
<b class="fc"><i>96</i>&nbsp;		this.dataStoreMap = dataStoreMap;</b>
<b class="fc"><i>97</i>&nbsp;	}</b>
<i>98</i>&nbsp;
<i>99</i>&nbsp;	public Map&lt;Class&lt;?&gt;, IdentifierGenerator&lt;?, ?&gt;&gt; getIdentifierGeneratorMap() {
<b class="nc"><i>100</i>&nbsp;		return identifierGeneratorMap;</b>
<i>101</i>&nbsp;	}
<i>102</i>&nbsp;
<i>103</i>&nbsp;	public void setIdentifierGeneratorMap(Map&lt;Class&lt;?&gt;, IdentifierGenerator&lt;?, ?&gt;&gt; identifierGeneratorMap) {
<b class="fc"><i>104</i>&nbsp;		this.identifierGeneratorMap = identifierGeneratorMap;</b>
<b class="fc"><i>105</i>&nbsp;	}</b>
<i>106</i>&nbsp;}
</div>
</div>

<div class="footer">
    
    <div style="float:right;">generated on 2012-07-17 20:23</div>
</div>
</body>
</html>
